#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main(){
int T, i;
int num = 1;
int emp;
int a[20] = { 0 };
int sum[20] = { 0 };
int* head;
scanf("%d", &T);
for (i = 0; i < T; ++i)
{
	scanf("%d", &(a[i]));
	head = ((int*)malloc(sizeof(int) * a[i]));
	for (emp = 0; emp < a[i]; ++emp)
	{
		scanf("%d", &(head[emp]));
		sum[i] += head[emp];
	}
	sum[i] -= a[i] - 1;
}
for (i = 0; i < T; i++) {
	printf("Case %d#: %d\n", num++, sum[num - 1]);
}
return 0;
}